package me.idashu.attg.service;

import java.util.Date;
import java.util.List;

import me.idashu.attg.domain.FeedBackEntity;
import me.idashu.attg.domain.PageEntity;
import me.idashu.attg.persistence.FeedbackMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class FeedbackService {

	@Autowired
	public FeedbackMapper feedbackMapper;
	
	public void insertFeedback(FeedBackEntity feedBackEnity){
		feedBackEnity.setTime(new Date());
		feedbackMapper.insertFeedBack(feedBackEnity);
	}
	
	public List<FeedBackEntity> findAllFeedBacks(PageEntity pageEntity){
		List<FeedBackEntity> feedBacks = feedbackMapper.findAllFeedBacks(pageEntity);
		return feedBacks;
	}
	
	public int findCountAllFeedBacks(){
		int count = feedbackMapper.findCountAllFeedBacks();
		return count;
	}
}
